<template lang="html">
  <Steps :current="status" class="Steps" size="small">
    <Step @click.native="to('1')" title="创建项目" content=""></Step>
    <Step @click.native="to('2')" title="资料收集" content=""></Step>
    <Step @click.native="to('3')" title="现场踏勘" content=""></Step>
    <Step @click.native="to('4')" title="环境质量及监测" content=""></Step>
    <Step @click.native="to('5')" title="报告编制及审核" content=""></Step>
    <Step @click.native="to('11')" title="报告送审" content=""></Step>
    <Step @click.native="to('12')" title="技术评估" content=""></Step>
    <Step @click.native="to('13')" title="报告报批" content=""></Step>
    <Step @click.native="to('14')" title="报告公示" content=""></Step>
    <Step @click.native="to('15')" title="报告存档" content=""></Step>
  </Steps>
</template>

<script>
  export default {
    name: 'StepBar',
    props: {
      status: {
        type: Number,
        required: 0,
      },
      viewOnly: {
        default: false
      }
    },
    methods: {
      to(type) {
        // console.log(type + '当前点击~~~~~~~~')
        let projectType = Number(localStorage.projectType)
        console.log(projectType)
        if (projectType < Number(type)) {
          // console.log('禁止走')
        } else {
          switch (type) {
            case "1":
              this.$router.push({
                name: "createProgram",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "2":
              this.$router.push({
                name: "dataCollection",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "3":
              this.$router.push({
                name: "reconnaissanceTrip",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "4":
              this.$router.push({
                name: "environmentQuality",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "5":
              this.$router.push({
                name: "reportReview",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "11":
              this.$router.push({
                name: "reportTria",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "12":
              this.$router.push({
                name: "technologyAssessment",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "13":
              this.$router.push({
                name: "reportApproval",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "14":
              this.$router.push({
                name: "reportPublicity",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
            case "15":
              this.$router.push({
                name: "reportArchives",
                query: {
                  ProjectId: this.$route.query.ProjectId || this.$route.query.Id,
                  viewOnly: this.viewOnly?1:0
                }
              })
              break;
          }
        }
      },
    }
  }
</script>

<style lang="css">
  .Steps {
    padding: 20px;
  }
</style>